package com.mgkj.mapper;

import com.mgkj.dto.PassiveTransferDocSubmitDto;
import com.mgkj.entity.InvBarcodeOperation;
import com.mgkj.entity.Lsmdt;

import com.mgkj.vo.BarCodeDetailVo;
import com.mgkj.vo.InvBarcodeOperationVo;
import com.mgkj.vo.PassiveEmployeeInfoVo;
import com.mgkj.vo.TransferBarcodeVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * Description:
 *
 * @Author LBB
 * @Create: 2024-12-08 18:08
 * @Version 1.0
 */

@Mapper
public interface PassiveMapper {

    void insertMiddleTable(Lsmdt lsmdt);

    void insertTransferMiddleTable(Lsmdt build);
    @Select("SELECT ISNULL(combination_lot_no,'') FROM bm_barcode_detail WHERE barcode = #{barcode}")
    String selectLotNumber(@Param("barcode") String barcode);

    List<TransferBarcodeVo> getTransferBarcodeInfo(@Param("barcode") String barcode);


    void UpdateBarcodeQty(@Param("barcode") String barcode, @Param("transferQty") Double transferQty);

    void batchUpdateBarcodeQty(@Param("qtyList")List<PassiveTransferDocSubmitDto> qtyList);

    List<PassiveEmployeeInfoVo> getEmployeeInfo(@Param("employeeNo") String employeeNo);

    BarCodeDetailVo getBarCodeDetailByBarCode(@Param("barcode")  String barcode);

    Double getQtySum(@Param("barcode") String barcode,@Param("chatType") Integer chatType);

    List<InvBarcodeOperationVo> queryInvBarcodeOperationVo(@Param("createBy")  String createBy);


    void deleteInvBarcodeOperationByCreateBy(@Param("createBy") String createBy,@Param("chagType") Integer chagType);

    List<InvBarcodeOperation> queryTransNotSubimtByTypeAndCreateBy(@Param("chagType") int chagType, @Param("createBy") String createBy,@Param("barcode")  String barcode);
    List<InvBarcodeOperation> queryNotSubimtByTypeAndCreateBy(@Param("chagType") int chagType, @Param("createBy") String createBy);

    @Update("UPDATE inv_barcode_operation SET status_code = '1' WHERE id = #{id}")
    boolean updateByid(@Param("id") String id);

    int updateBmBarcodeDetailOfQty(@Param("barcode") String barcode,@Param("qty") double qty);

    List<InvBarcodeOperationVo> queryToOrOutInvBarcodeOperationVo(@Param("createBy")  String createBy,@Param("chagType")  Integer chagType);

}
